require 'rho/rhocontroller'
require 'helpers/browser_helper'

class TasboCalController < Rho::RhoController
  include BrowserHelper

  #GET /TasboCal
  def index
    @tasbocals = TasboCal.find(:all)
    render :back => '/app'
  end

  # GET /TasboCal/{1}
  def show
    @tasbocal = TasboCal.find(@params['id'])
    if @tasbocal
      render :action => :show, :back => url_for(:action => :index)
    else
      redirect :action => :index
    end
  end

  # GET /TasboCal/new
  def new
    @tasbocal = TasboCal.new
    render :action => :new, :back => url_for(:action => :index)
  end

  # GET /TasboCal/{1}/edit
  def edit
    @tasbocal = TasboCal.find(@params['id'])
    if @tasbocal
      render :action => :edit, :back => url_for(:action => :index)
    else
      redirect :action => :index
    end
  end

  # POST /TasboCal/create
  def create
    @tasbocal = TasboCal.create(@params['tasbocal'])
    redirect :action => :index
  end

  # POST /TasboCal/{1}/update
  def update
    @tasbocal = TasboCal.find(@params['id'])
    @tasbocal.update_attributes(@params['tasbocal']) if @tasbocal
    redirect :action => :index
  end

  # POST /TasboCal/{1}/delete
  def delete
    @tasbocal = TasboCal.find(@params['id'])
    @tasbocal.destroy if @tasbocal
    redirect :action => :index  end
end
